package com.ccmusic.entity;

import java.util.Date;

/**
 * 评论的实体类
 * @author cyf
 *
 */
public class Comments {
	private int cid;//评论表的id
	private int mid;//音乐的id
	private int uid;//用户的id
	private String contents;//评论的内容
	private String cdate;//评论的时间
	
	/**
	 * 部分参数的构造，cid自动递增，时间自动生成当前时间
	 * @param mid 音乐的id
	 * @param uid 用户的id
	 * @param contents 评论的内容
	 */
	 public Comments(int mid, int uid, String contents) {
		super();
		this.mid = mid;
		this.uid = uid;
		this.contents = contents;
	}
	{
		this.cdate=new Date().toLocaleString();
	}
	
	public Comments() {
		// TODO Auto-generated constructor stub
	}
	
	/**
	 * 带单个cid成员的构造函数，用于删除评论所需对象使用	
	 * @param cid
	 */
	public Comments(int cid) {
		super();
		this.cid = cid;
	}




	/**
	 * 带参构造
	 * @param cid：评论表的id
	 * @param mid 音乐的id
	 * @param uid 用户的id
	 * @param contents 评论的内容
	 * @param cdate 评论的时间
	 */
	
	public Comments(int cid, int mid, int uid, String contents, String cdate) {
		super();
		this.cid = cid;
		this.mid = mid;
		this.uid = uid;
		this.contents = contents;
		this.cdate = cdate;
	}
	@Override
	public String toString() {
		return "Comments [cid=" + cid + ", mid=" + mid + ", uid=" + uid + ", contents=" + contents + ", cdate=" + cdate
				+ "]";
	}
	public int getCid() {
		return cid;
	}
	public void setCid(int cid) {
		this.cid = cid;
	}
	public int getMid() {
		return mid;
	}
	public void setMid(int mid) {
		this.mid = mid;
	}
	public int getUid() {
		return uid;
	}
	public void setUid(int uid) {
		this.uid = uid;
	}
	public String getContents() {
		return contents;
	}
	public void setContents(String contents) {
		this.contents = contents;
	}
	public String getCdate() {
		return cdate;
	}
	public void setCdate(String cdate) {
		this.cdate = cdate;
	}
	
	
}
